import java.net.*;
import java.io.*;
import java.util.*;

import Engine.Player;

public class GameServer {

    public static void main(String[] args) {
		ArrayList<Player> RegisteredPlayers = new ArrayList<Player>();
		int inputPort = 19998;
		int outputPort = 19999;
		int count = 0;
		
		try{
		    ServerSocket ssin = new ServerSocket(inputPort);
		    ServerSocket ssout = new ServerSocket(outputPort);
		    System.out.println("GameServer Initialized");
	
		    while (true) {
				Socket sin = ssin.accept();
				Socket sout = ssout.accept();
				
				Runnable runnable = new ActionHandler(RegisteredPlayers, sin, sout, ++count);
				Thread thread = new Thread(runnable);
		
				thread.start();
	
		    }
		}
		catch (Exception e) {
			System.out.println(e.getMessage());
		}
    }

}    
    
